package com.heima.media.controller;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.heima.common.dto.ResponseResult;
import com.heima.media.dto.ChannelDto;
import com.heima.media.entity.WmChannel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.media.service.IWmChannelService;

import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.RestController;

//频道信息表 控制器
@RestController
@RequestMapping("/api/v1/channel")  //公司里面  会跟上版本信息
public class WmChannelController {

    @Autowired
    private IWmChannelService wmChannelService;

//模糊查询分页列表
    @PostMapping("/list")
    public ResponseResult listByName(@RequestBody ChannelDto dto) {

        return wmChannelService.listByName(dto);
    }

//    保存频道
@PostMapping
public ResponseResult saveChannel(@RequestBody WmChannel channel){
    return wmChannelService.saveChannel(channel);
}
}
